

 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 <html lang="zh-CN">
 <head>
 	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
 	<link href="./css/bootstrap.min.css" rel="stylesheet">
    <link href="./css/main.css" rel="stylesheet">

    <link href="./css/bootstrap-theme.min.css" rel="stylesheet">
	
    <link href="theme.css" rel="stylesheet">
 	<title>Document</title>

 </head>

	


 	<style type="text/css">
		.box{
			margin-top: 50px;
		}
		.juzhong{
			position: relative;
			left: 100px;
			
		}

		.ppp{
			text-align: center;
		}
		#clear{
			float: none;
			margin: 0 auto;
			display: inline-block;
			position: relative;
		}
		#cla{
			color: #ffffff;
			cursor: default;
			float: none;
			display: inline-block;	
		}
		.sm2{
			height: 100%;			
			/*border: 1px solid #000;*/
		}
		.sm1{
			height: 100px;	
			margin-top: 50px;		
			/*border: 1px solid #000;*/
		}
		.bg, .bg1{
			height: 40px;
			width: 150px;
			position: absolute;
			left: 0px;
			top: 0px;
			opacity: 0;
			cursor: pointer;
		}
		.bg1{
			width: 80px;
			
		}

		.bgimg1, .bgimg2{
			height: 40px;
			width: 170px;			
			position: relative;
			left: 200px;
			top: 30px;
			background: url(./images/bg1.png);
			background-position: 2px;
			border-radius: 4px;
		}
		.bgimg2{
			top: -10px;
			left: 760px;
			width: 80px;
			background: url(./images/bg2.png) no-repeat;
			background-position: -6px;
			
		}
		table{
			border-collapse:collapse;
			margin: 0 auto;
			margin-top: 60px;
			
		}
		img{
			width: 60px;
			height: 60px;
		}
		tr{
			width: 1022px;
			height: 30px;
			border: 1px solid #A39090;
		}
		th , td{
			width: 150px;
			border: 1px solid #A39090;
			text-align: center;
		}
		td{
			height: 60px;
		}
		a{
			cursor: pointer
		}
		#li{
			display: inline-block;
			margin: 0px;
			padding: 0px;
			float: left;
		}
		#li a{
			width: 34px;
			height: 34px;
			margin: 0px;
			padding: 6px 0px;
			text-align: center;			
		}
 	</style>
 <body>

	<nav class="navbar navbar-inverse navbar-fixed-top">
      <div class="container ppp">
        <div class="navbar-header " id="clear">
          <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
            <span class="sr-only">Toggle navigation</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="navbar-brand" id="cla" href="#">文件上传下载中心</a>
          
        </div>
        
      </div>
    </nav>

    <div class="container box">

   		<div class="col-xs-12 sm1">
			<form action="" method="post" enctype="multipart/form-data">
				<div class="hidden" name="MAX_FILE_SIZE" value="1024000"></div>
				<div class="bgimg1"><input class="bg" type="file" name="file[]"  multiple="true" ></div>				
				
				<div class="bgimg2"><input class="bg1" type="submit" name="submit"></div>				
			</form>
   		</div>	
<?php 
	define('CONFIG_PATH','./config.php');
	include './function.php';
	include './Upload.class.php';

	if($_FILES){
		$config = array(
		'path'=>'./Face/',
		'size'=>'500000',
		'type'=>array('.png','.jpg','.gif'),
		);
		
		$obj  = new Upload($config);

		$obj->save();
	}
 ?>   		
		<div class="col-xs-12 sm2">
			
				
			
			<table id = "table">
   				<tr id = "tr">
					<th>图片</th>
					<th>图片名</th>
					<th>上传时间</th>
					<th>大小</th>
					<th>下载</th>
					<th>删除</th>
				</tr>
<?php 
	
	
	if($_GET){
		$page = $_GET['page'];
	}else{
		$page = 1;
	}
	
	$p = page($page, 4, './Face/');


	$offset = $p[0];

	$path = $p[1];
	

	foreach ($path as $value) {

		$b =  date("Y-m-d H:i:s",filemtime($value));
        $filesize = filesize($value);
		$value = iconv("gb2312","UTF-8", $value);
		$str = strrchr($value, '.');
		// $arr = ['.jpg', '.png', '.gif', '.pwf'];
		$pp = strrchr($value, '/');
        
 ?>		
				
	
   				<tr>
   					<td><?php 

   								echo "<img src=\"$value\" alt=''>";

   						?>
   					</td>
   					<td><?php echo $pp; ?></td>
   					<td><?php echo $b; ?></td>
   					<td><?php echo $filesize; ?></td>
   					
   					<td><a href="./down.php?name=<?php echo $value ?>" class="glyphicon glyphicon-download-alt" aria-hidden="true"></a></td>
   					<td><a href="./del.php?name=<?php echo $value ?>" class="glyphicon glyphicon-trash" aria-hidden="true"></a></td>
   				</tr>
<?php } ?>
			
			</table>
   			
   				
				
				<div class="col-xs-12 sm1">

					<nav style="padding-left:23%;">

					<ul class="pagination juzhong" style="width:34px;height:34px;display:inline-block;" >

					    <li id = 'prev' style="display:none;">
					      <a  aria-label="Previous" >
					        <span aria-hidden="true">&laquo;</span>
					      </a>
					    </li>
						
				
					</ul>
					<ul class="pagination juzhong" id="ul">
						
						<?php
						
						for ($i=1;$i <= $offset;$i++) {  //循环显示出页面
						?>
					    <li id="li" class="li"><a><?php echo $i ;?></a></li>
					  	<?php
						}
						?>
					</ul>

					<ul class="pagination juzhong" style="width:34px;height:34px;display:inline-block;">
					    <li id = 'next'>
					      <a  aria-label="Next">
					        <span aria-hidden="true">&raquo;</span>
					      </a>
					    </li>	
					 </ul>
					</nav>
				</div>	
				
   				
   		</div>	
    </div><!-- /.container -->


    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
    <script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    
    <script src="./js/ajax.js"></script>

 </body>
 </html>